<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <style>
        ul li{
            background-color: violet;
            list-style: none;
        }
        .red{
            background-color: red;
            width: 80px;
           
        }
        .black{
            background-color: yellow;
            width: 130px;
            font-size: 30px;
        }
    </style>
    <div id="app">
     <div v-if="isbool" @click="getshow" :class="{red:setRed}">
         安全操作
     </div>
     <div v-else @click="getshow" :class="{black:setBlack}">
         危险操作
     </div>
      
    </div>
    <script src="../js/vue.js"></script>
    <script>
        const app = new Vue({
            el:"#app",
            data:{
                show:[
                    {"name":"安全的操作",flage:true},
                    { "name": "危险的操作", flage: true }
                    
                ] ,
                isbool: true,
                setRed:true,
                setBlack:true
            },
           
            methods:{
                getshow(){
                   this.isbool=!this.isbool
                }
            }
        })
    </script>
</body>
</html>